<html>
<head><meta charset="utf-8"><title>Cargo file collision warning · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Cargo.20file.20collision.20warning.html">Cargo file collision warning</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204194355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Cargo%20file%20collision%20warning/near/204194355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> T. Rapp <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Cargo.20file.20collision.20warning.html#204194355">(Jul 17 2020 at 11:17)</a>:</h4>
<p>Hi! When cargo-building some project with the recent rustc v1.45.0 new warning messages pop up:</p>
<div class="codehilite"><pre><span></span><code>The bin target &#39;foo-bar&#39; in package ... has the same output filename as the lib target &#39;foo_bar&#39; in package ...
Colliding filename is: C:\...\foo_bar.pdb
</code></pre></div>


<p>Both target names differ in the separator being either an underscore or hyphen character. The linker PDB output file always seems to use an underscore, though.</p>



<a name="204194815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Cargo%20file%20collision%20warning/near/204194815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> T. Rapp <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Cargo.20file.20collision.20warning.html#204194815">(Jul 17 2020 at 11:23)</a>:</h4>
<p>Are the linker arguments generated in rustc or cargo? Any pointers where to look in source code?<br>
I would like to find out where the PDB output filename is set.</p>



<a name="204201807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Cargo%20file%20collision%20warning/near/204201807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> T. Rapp <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Cargo.20file.20collision.20warning.html#204201807">(Jul 17 2020 at 12:53)</a>:</h4>
<p>Ok, think I found the relevant lines in <code>src/librustc_codegen_ssa/back/linker.rs</code> of the Rust code.<br>
Unfortunately looks like the PDB output filename is auto-generated by MSVC <code>link.exe</code>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>